package at.jsug.topicvoting.gwt1.client.logic;

import at.jsug.topicvoting.gwt1.client.logic.controller.DeleteVoteCommand;
import at.jsug.topicvoting.gwt1.client.logic.controller.NewTopicCommand;
import at.jsug.topicvoting.gwt1.client.logic.controller.SaveTopicCommand;
import at.jsug.topicvoting.gwt1.client.logic.controller.SaveVoteCommand;
import at.jsug.topicvoting.gwt1.client.logic.event.DeleteVoteEvent;
import at.jsug.topicvoting.gwt1.client.logic.event.NewTopicEvent;
import at.jsug.topicvoting.gwt1.client.logic.event.SaveTopicEvent;
import at.jsug.topicvoting.gwt1.client.logic.event.SaveVoteEvent;

public class FrontController {

	private static boolean initialized = false;
	
	public static void initialize() {

		if(initialized == true) {
			System.err.println("WARNING: FrontController already initialized!");
			return;
		}
		initialized = true;
		
		
		FrontDispatcher.getInstance().register(NewTopicEvent.EVENT_ID, new NewTopicCommand());
		
		FrontDispatcher.getInstance().register(SaveTopicEvent.EVENT_ID, new SaveTopicCommand());
		
		FrontDispatcher.getInstance().register(SaveVoteEvent.EVENT_ID, new SaveVoteCommand());
		
		FrontDispatcher.getInstance().register(DeleteVoteEvent.EVENT_ID, new DeleteVoteCommand());
		
		
		
		
		
		
		
		
		
	}
	
}
